<h2 class="h2-title">Chi tiết đơn hàng !!!</h2>

    <ul class="notification succ" id="orderup" style="display: none;">
        <li class="notifi_img"><img src="<?=base_url()?>assets/backend/css/images/icons/tick_circle.png"/></li>

        <li class="msg"><?=$this->native_session->flashdata('msg')?></li>

        <li class="close"><img src="<?=base_url()?>assets/backend/css/images/icons/cross_grey_small.png"/></li>

    </ul><!--End of .notification -->

<div id="orderleft" style="min-height: 500px;">
    <p class="order_title">Thông tin khách hàng</p>

    <?php if(!empty($order)):?>
    <ul class="order_content">
        <li>Họ tên: <span><?=$order->customer_name?></span></li>
        <li>Điện thoại: <span><?=$order->customer_phone?></span></li>
        <li>Email: <span><a style="color: #00A6DD;" href="mailto:<?=$order->customer_email?>"><?=$order->customer_email?></a></span></li>
        <li>Địa chỉ: <span><?=$order->customer_address?></span></li>
        <li>Trạng thái hoá đơn: <span>
            <?php if($order->order_status == 0):?>
                Chờ xử lý
            <?php elseif($order->order_status == 1):?>
                Hoàn thành
            <?php else:?>
                Huỷ
            <?php endif;?>
        </span></li>
    </ul>
    <?php endif;?>
    <p class="order_title" style="margin-top: 30px!important;">Sản phẩm trong đơn hàng</p>

    <table class="table order" style="width: 100%!important; margin: 0 auto;">
        <thead>
            <th>#</th>
            <th>Sản phẩm</th>
            <th>Số lượng</th>
            <th>Giá</th>
            <th>Tổng</th>
        </thead>

        <tbody>
        <?php if(!empty($order_items)):?>
            <?php $count = 1;?>
            <?php foreach($order_items as $item):?>
            <tr>
                <td><?=$count?></td>
                <td><?=$item->product_name?></td>
                <td><?=$item->quantity?></td>
                <td><?=number_format($item->price,0,",",".")?> đ</td>
                <td><?=number_format($item->price*$item->quantity,0,",",".")?> đ </td>
            </tr>
            <?php $count++?>
            <?php endforeach;?>
        <?php endif;?>
        </tbody>
    </table>
</div><!--End of #orderleft -->

<div id="orderright" style="min-height: 500px;">
    <ul class="b">
        <li>Tổng thanh toán</li>
        <li>
            <a id="print" href="<?=base_url()?>backend/cart/export2pdf/<?=$order->order_id?>">In hoá đơn</a>
        </li>
    </ul>

    <div style="clear: both;"></div>

    <?php if(!empty($order)):?>
    <form action="#" method="POST">
    <ul class="order_content">
        <li>Tổng giá trị đơn hàng: <span><?=number_format($order->total,0,",",".")?> đ</span></li>
        <li>Chi phí vận chuyển:
            <input type="text" value="<?=$order->order_ship?>" <?php if($order->order_status==1 || $order->order_status==2) echo " disabled ";?> name="ordership" />
        </li>
        <li>Tổng: <span>
        <?php if($order->order_total != 0):?>
            <?=number_format($order->order_total,0,",",".")?> đ
        <?php else:?>
            <?=number_format($order->total,0,",",".")?> đ
        <?php endif;?>
        </span></li>
    </ul>

    <p class="order_title">Ghi chú</p>

    <textarea cols="38" rows="10" style="padding: 10px;" disabled=""><?=$order->customer_cm?></textarea>

    <p style="margin-top: 15px;font-size: 1.1em">Thời gian đặt hàng: <span style="color: red;font-size: 1.2em!important;font-weight: bold"><?=$order->order_date?></span></p>
    <?php endif;?>

    <ul style="margin-top: 30px;margin-left: 51px" id="order_bnt">
        <input type="submit" name="updateship" id="updateship" style="text-align: center" class="sub" value="Cập nhật"  />

        <li class="order_bnt_up">
            <a class="bnt" href="<?=base_url()?>backend/cart">Quay lại</a>
        </li>
    </ul>
    <input type="hidden" name="order_id" value="<?=$order->order_id?>" />
    </form>
</div><!--End of #orderright -->
